﻿using System.Collections.Generic;

namespace ZLWeb.WebApiConfigration.PipeConfig
{
    /// <summary>
    ///     通用数据管道配置DTO
    /// </summary>
    public class DefinedFunction
    {
        /// <summary>
        /// 存储过程名称
        /// </summary>
        public string StoreProcName { get; set; }

        /// <summary>
        /// 对应服务名称
        /// </summary>
        public string FunctionName { get; set; }
        /// <summary>
        ///     标量参数
        /// </summary>
        public Dictionary<string, ScalarParam> ScalarPars { get; set; }

        /// <summary>
        ///     集合参数
        /// </summary>
        public Dictionary<string, RecondParam> RecondPars { get; set; }
    }

    /// <summary>
    ///     标量参数对应属性
    /// </summary>
    public class ScalarParam
    {
        /// <summary>
        ///     参数名
        /// </summary>
        public string ParamName { get; set; }

        /// <summary>
        ///     参数对应MSSQL数据类型
        /// </summary>
        public string ParamDbType { get; set; }

        /// <summary>
        ///     是否需要输出
        /// </summary>
        public bool OutPut { get; set; }
    }


    public class RecondParam
    {
        /// <summary>
        ///     表参数名称
        /// </summary>
        public string ParamTableName { get; set; }

        /// <summary>
        ///     是否自增
        /// </summary>
        public bool NeedAttachSN { get; set; }

        /// <summary>
        ///     是否需要输出
        /// </summary>
        public bool OutPut { get; set; }

        /// <summary>
        ///     临时表字段集合
        /// </summary>
        public Dictionary<string, RecondFild> RecondFilds { get; set; }
    }

    public class RecondFild
    {
        /// <summary>
        ///     字段名
        /// </summary>
        public string FildName { get; set; }

        /// <summary>
        ///     参数对应MSSQL数据类型
        /// </summary>
        public string FildDbType { get; set; }

        /// <summary>
        ///     是否可为NULL
        /// </summary>
        public bool Nullable { get; set; }
    }
}